Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move hooks under own directory #1042

Merged
merged 6 commits into from
Oct 10, 2023
Merged

refactor: move hooks under own directory #1042

merged 6 commits into from
Oct 10, 2023

Conversation

NikitaCG
Copy link
Contributor

@NikitaCG NikitaCG commented Oct 6, 2023

  • useActionHandlers
  • useFileInput
  • useUniqId
  • useForkRef

also moved constants.ts in right folder

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

...refs: Array<React.Ref<T> | undefined>
): React.RefCallback<T> | null {
export type UseForkRefProps<K> = Array<React.Ref<K> | undefined>;
export type UseForkRefResult<W> = React.RefCallback<W> | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is W?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generic variable

@@ -16,18 +16,20 @@ export type UseFileInputOutput = {
};
};

export type UseFileInputResult = UseFileInputOutput;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's mark old type with deprecation note

import {useUniqId} from '@gravity-ui/uikit';
```

The `useUniqId` hook create uniq Id.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creates unique ID


## Result

Id. `string`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ID

import {useForkRef} from '@gravity-ui/uikit';
```

The `useForkRef` hook that can combine refs into a single Ref
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lowercase:

single ref

@amje amje changed the title fix: refactor hooks refactor: move hooks under own directory Oct 10, 2023
@amje amje merged commit 60a94b0 into main Oct 10, 2023
3 checks passed
@amje amje deleted the fix/refactor-hooks branch October 10, 2023 14:31
@NikitaCG NikitaCG mentioned this pull request Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants